package com.dbs.donatebooksystem.controller;

import cn.hutool.core.lang.Dict;
import com.dbs.donatebooksystem.Service.WebaseUserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class WebaseUserController {
    @Autowired
    WebaseUserService userService;
    @GetMapping("addRole")
    public Dict addUser(String address, String addr, String role) {
        return userService.addUser(address, addr, role);
    }

    @GetMapping("register")
    public Dict register(int type, String addr) {
        return userService.registerUser(type, addr);
    }

    @GetMapping("listUser")
    public Dict getUserfotId(String address, int userId) {
        return userService.getUserfotId(address, userId);
    }

}
